package goodsModel

import (
	"gitee.com/libwiki/lib-mall/models"
	"gitee.com/libwiki/lib-mall/package/vars"
)

// GoodsSource 货源
type GoodsSource struct {
	Code         string    `json:"code" gorm:"type:varchar(64);comment:商品货源唯一code"`
	Name         string    `json:"name" gorm:"comment:货源标题"`
	Desc         string    `json:"desc" gorm:"comment:货源描述"`
	AdvertImages []byte    `json:"advert_images" gorm:"comment:广告轮播图"`
	InfoImages   []byte    `json:"info_images" gorm:"comment:详情长图"`
	ExtendAttrs  []byte    `json:"extend_attrs" gorm:"comment:扩展属性"`
	LockPrice    bool      `json:"lock_price" gorm:"comment:是否锁定零售价（锁定后，代理尽可按建议零售价出售）"`
	LockBonus    bool      `json:"lock_bonus" gorm:"comment:锁定库存（锁定库存后购买不会减少库存）"`
	LockStock    bool      `json:"lock_stock" gorm:"comment:锁定佣金（锁定后代理不可更改指定的佣金）"`
	Returnable   bool      `json:"returnable" gorm:"comment:是否支持退货"`
	IsPrivate    bool      `json:"is_private" gorm:"comment:是否私密货源，私密货源，仅自身店铺可见"`
	AutoProxy    bool      `json:"auto_proxy" gorm:"comment:支持一键代理（1：代理商品无需审核"`
	Status       bool      `json:"status" gorm:"comment:上架、下架状态"`
	Uid          uint      `json:"uid" gorm:"comment:所属用户"`
	StoreId      uint      `json:"store_id" gorm:"comment:所属门店"`
	Type         vars.Enum `json:"type" gorm:"default:logistics;type:enum('logistics','virtual','service');comment:物流、虚拟、服务"`
	SourceType   vars.Enum `json:"source_type" gorm:"default:product;type:enum('agent','product');comment:代理、自卖货源"`

	models.BaseModel
	models.DeleteField
}
